Procházet zdrojové kódy

Merge branch 'dev' of github.com:nightscout/Trio into patch/0.8.1-with-dev-removed-old-omni-submodules

Deniz Cengiz před 4 dny
rodič
revize
068d8e59ef
1 změnil soubory, kde provedl 10 přidání a 3 odebrání
  1. 10 3
      Trio/Sources/APS/APSManager.swift

+ 10 - 3
Trio/Sources/APS/APSManager.swift

@@ -583,11 +583,18 @@ final class BaseAPSManager: APSManager, Injectable {
         do {
             try await pump.enactBolus(units: roundedAmount, automatic: isSMB)
             debug(.apsManager, "Bolus succeeded")
-            if !isSMB {
-                try await determineBasalSync()
-            }
             bolusProgress.send(0)
             callback?(true, String(localized: "Bolus enacted successfully.", comment: "Success message for enacting a bolus"))
+            if !isSMB {
+                do {
+                    try await determineBasalSync()
+                } catch {
+                    warning(
+                        .apsManager,
+                        "determineBasalSync after manual bolus failed: \(error.localizedDescription)"
+                    )
+                }
+            }
         } catch {
             warning(.apsManager, "Bolus failed with error: \(error)")
             processError(APSError.pumpError(error))